Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graceful-git

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graceful-git

Executes git commands gracefully. Retries them on errors

  • 3.1.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

graceful-git

Executes Git commands gracefully. Retries on errors

Git is called by absolute path to avoid binary planting attacks on Windows.

npm version

Installation

<npm|yarn|pnpm> add graceful-git

Usage

'use strict'
const gracefulGit = require('graceful-git')

gracefulGit(['status', 'README.md'])
  .then(result => console.log(result.stdout))
  .catch(err => console.error(err))
  //> On branch master
  //  Your branch is based on 'origin/master', but the upstream is gone.
  //    (use "git branch --unset-upstream" to fixup)
  //  nothing to commit, working directory clean

API

git(args, [opts]) => Promise

Arguments:

  • args - string[] - arguments passed to the Git CLI
  • opts.cwd - Path - the directory in which the Git command should be executed
  • ...opts - object - optional. Parameters used by retry when git operation fails.

git.noRetry(args, [opts]) => Promise

Same as git() but without retries.

License

MIT © Zoltan Kochan

Keywords

FAQs

Package last updated on 16 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc